#pragma once
#include <iostream>
#include <sys/mman.h>
void* my_malloc(size_t sz)
{
    void* shmaddr = mmap(nullptr,sz,PROT_READ | PROT_WRITE,MAP_ANONYMOUS | MAP_PRIVATE,-1,0);
    if(shmaddr == MAP_FAILED)
    {
        std::cerr << "failed to mmap!" << std::endl;
        return nullptr;
    }
    return shmaddr;
}

void my_free(void* addr , size_t sz)
{
    if(addr != nullptr)
    {
        munmap(addr,sz);
    }
}
